# -*- coding: utf-8 -*-
# @Time    : 2021/4/12 22:06
# @Author  : N
# @Email   : 
# @File    : dj.py.py
# @Software: PyCharm
#生成一个大文件Ipswich.txt..........
# import  random
# a={}
# with open("dj.txt","a+") as fp:
#     for i in range(256):
#         s = random.randint(0,256)
#         fp.write("172.162.0."+str(s)+"\n")
#     for i in open("dj.txt"):
#         if i[10:] in a:
#             a[i[10:]] += 1
#         else:
#             a[i[10:]] =1
#     for i,j in a.items():
#         print("172.162.0.",i,j,"次")




#访客：编写一个程序，提示用户输入其名字；用户做出响应后，将其名字写入guest.txt文件中
# while True:
#     c = input("请输入你需要输入的名字(退出请按k)：")
#     if c=="k":
#         break
#     else:
#         with open("dj2.txt", "a+", encoding="utf-8") as fp1:
#             fp1.write("你的名字有：" + c + "\n")


 # 生成一个100个MAC地址并写入文件中，MAC地址前6位（16进制）位01-AF-3B
# import random
# with open("MAC.txt","a+") as op2:
#     for i in range(10):
#         for i in range(3):
#             a = random.randint(0, 9)
#             b = chr(random.randint(65, 70))
#             # 利用ASCII表转换随机数
#             if i ==1:
#                 c = str(a)+b
#             elif i ==2:
#                 d = str(a)+b
#             else:
#                 e = str(a)+b
#         op2.write('01-AF-3B'+'-'+c+'-'+d+'-'+e+'\n')
#网尔登湖
# a={}
# import  string
# punc =string.punctuation
# b={punc}
# with open("Walden.txt",encoding="utf-8") as fp4:
#     for i in fp4:
#         for j in i.upper().split():
#             if j.isalpha():
#                 if j in a:
#                     a[j]+= 1
#                 else:
#                     a[j]=1
# print(a)









